
# 测试博客详情页
from selenium.webdriver.common.by import By

from common.Utils import BlogDriver


class BlogDetail:
    url = ""
    driver = ""
    def __init__(self):
        self.url = "file:///D:/gitee%E8%BF%9C%E7%A8%8B%E5%85%B3%E8%81%94%E5%BA%93/front-end/Blog_system/BlogPage/html/blog_content.html?blogId=1"
        self.driver = BlogDriver.driver
        self.driver.get(self.url)

    # 测试登录状态下，博客详情页测试用例
    def DetailTestByLogin(self):
        # 测试标题是否存在
        self.driver.find_element(By.CSS_SELECTOR,"body > div.container > div.container-right > div > div.title")
        # 测试时间是否存在
        self.driver.find_element(By.CSS_SELECTOR,"body > div.container > div.container-right > div > div.date")
        # 测试详情页是否存在
        self.driver.find_element(By.CSS_SELECTOR,"body > div.container > div.container-right > div > div.desc")

        # 屏幕截图
        BlogDriver.getScreeShot()